﻿using System;
using System.Globalization;
using System.Windows.Forms;
using SVM;
using YahContent;



namespace Training
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private const string Filetest = @"../../../../data/test.txt";
        private const string Filemodel = @"../../../../data/vector.model";
        private const string Filetrain = @"../../../../data/vector.train";
        private void button1_Click(object sender, EventArgs e)
        {
            var problemTrain = Problem.Read(Filetrain);
            var problemTest = Problem.Read(Filetest);
            var parameter = new Parameter();
            var model = SVM.Model.Read(Filemodel);
            var x = new DataAttri();
            x.TextLenght = 1001;
            x.NumberOfLongText = 2;
            x.NumberOfParagraph = 3;
            x.NumberOfSum = 2951;
            x.NumberOfImage = 8;
            x.NumberOfSmallImage = 1;
            x.NumberOfTag = 16;
            richTextBox1.Text += Prediction.Predict(model, x.GetNodes()).ToString(CultureInfo.InvariantCulture) +"\n"+ x.GetVector();
            

        }
    }
}